<template>
	<div>
		<div class="topImg">
			<div class="title">
				<div>解决方案</div>
				<img src="../assets/tline.svg" style="width: 60px;height: 4px;" />
			</div>
			<div class="tabs leftTan">
				<div class="iconbox">
					<img src="../assets/home.svg" />
				</div>
				<div>
					<el-breadcrumb separator="/">
						<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
						<el-breadcrumb-item>解决方案</el-breadcrumb-item>
					</el-breadcrumb>
				</div>
			</div>
		</div>

		<div style="width: 90%;margin: 20px auto;">
			<el-row :gutter="10">
				<div v-for="item in solutionList">
				<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
					<div class="jjfabox">
						<div class="imgbox">
							<img class="imgbg" :src="item.image" />
							<div class="tips">
								<div>{{item.toniNewsSection_dictText}}</div>
								<img src="../assets/sanjiao.svg" />
							</div>
						</div>
						<div style="width: 100%;height: 40px;background-color: #fff;"></div>
						<div class="textbox">
							<div class="title">
								{{item.title}}
							</div>
							<div class="txtD">
								{{item.excerpt}}
							</div>
						</div>
						<router-link :to="'/solutionDetail/'+item.id">
							<div class="more">
								查看详情
								<i class="el-icon-arrow-right"></i>
							</div>
						</router-link>
					</div>
				</el-col>
				</div>
			</el-row>
		</div>
		<el-pagination background :page-size="pageSize"  @current-change='currentChange' layout="prev, pager, next" :total="total">
		</el-pagination>
	</div>
</template>

<script>
	import vueSeamlessScroll from 'vue-seamless-scroll'
	export default {
		name: 'Home',
		components: {
			vueSeamlessScroll
		},
		data() {
			return {
				solutionList: [],
				pageNo: 1,
				pageSize: 3,
				emps: [],
				total: 10
			}
		},
		filters: {

		},
		created() {
			this.getSolutionlist()
		},
		mounted() {
			// this.getNewslist()
		},
		beforeDestroy() {},
		methods: {
			getSolutionlist() {
				var id = this.$route.params.id;
				var api = '/toni/webIndex/newsPageList?pid=' + id + '&pageNo=' + this.pageNo + '&pageSize=' + this
				.pageSize;
				this.$axios.get(api)
					.then((res) => {
						this.emps = res.data.result;
						this.total = res.data.result.total;
						this.solutionList = res.data.result.records;
						console.log('solutionList', res)
						this.solutionList.forEach((key) => {
							key.image = 'https://tonisoft.hy2w.com/toniboot/sys/common/static/' + key.image
							key.issueDate = /\d{4}-\d{1,2}-\d{1,2}/g.exec(key.issueDate)[0]
						})
					})
			},
			currentChange(currentPage) {
				this.pageNo = currentPage;
				this.getSolutionlist();
			},
		},
		computed: {},
		watch: {
			// 如果路由有变化，会再次执行该方法
			'$route': 'initEmps'
		},
	}
</script>

<style>
	@media screen and (max-width:539px) {
		.topImg {
			background-image: url(../assets/lm-ban2.jpg);
			background-position: 10%;
			width: 100%;
			height: 40vh;
			color: #fff;
			position: relative;
		}

		.topImg .title {
			font-size: 26px;
			font-weight: bold;
			line-height: 20px;
			position: absolute;
			top: 40%;
			left: 6%;
		}

		@keyframes slideInFromLeft {
			0% {
				background-color: transparent;
				/* 动画开始时背景色透明 */
			}

			100% {
				background-color: rgba(255, 255, 255, 0.1);
				/* 动画结束时的背景色 */
			}
		}

		/* 应用动画到元素 */
		/* .slide-in-animation {
		  animation: slideInFromLeft 2s ease-in-out forwards;
		} */
		.tabs {
			width: 100%;
			height: 18%;
			position: absolute;
			left: 0;
			bottom: 0;
			display: flex;
			align-items: center;
			background: rgba(255, 255, 255, 0.1);
			/* animation: slideInFromLeft 4s ease-in-out forwards; */
		}

		.leftTan {
			visibility: visible;
			animation-name: fadeInLeft;
			/*fadeInLeft为要使用的动画效果名，在这里不需要加animate前缀*/
			animation-duration: 3s;
		}


		.iconbox {
			width: 50px;
			height: 100%;
			background: #FDD000;
			display: inline-block;
			vertical-align: middle;
			text-align: center;
			margin: 0 2% 0 6%;
		}

		.tabs img {
			width: 20px;
			height: 100%;

		}

		.el-breadcrumb__inner a,
		.el-breadcrumb__inner.is-link {
			font-size: 14px;
			font-weight: 700;
			text-decoration: none;
			transition: color .2s cubic-bezier(.645, .045, .355, 1);
			color: #848692;
		}

		.el-breadcrumb__separator {
			margin: 0 9px;
			font-weight: 700;
			color: #848692;
		}

		.el-breadcrumb__inner {
			color: #fff;
			font-size: 14px;
			font-weight: 700;
		}

		.el-breadcrumb__item:last-child .el-breadcrumb__inner,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner a,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover {
			font-weight: 700;
			color: #fff;
			font-size: 14px;
			cursor: text;
		}

		.jjfabox {
			/* height: 40vh; */
			box-shadow: 0px 8px 36.8px 3.2px rgba(0, 0, 7, 0.1);
			position: relative;
			overflow: hidden;

		}

		.imgbox img {
			width: 100%;
			overflow: hidden;
		}

		.textbox {
			width: 100%;
			transition: transform 0.3s;
			padding: 20px;
			position: absolute;
			transform: translateY(100%);
			/* 初始状态卡片在右侧 */
			bottom: 110px;
			transition: transform 0.3s;
			z-index: 1;
			background-color: #fff;
		}

		.jjfabox:hover .textbox {
			transform: translateY(50%);
			/* opacity: 1; */
		}

		.jjfabox:hover .title {
			color: #FDD000;
		}

		.jjfabox:hover .imgbg {
			transform: scale(1.1);
		}

		.imgbox {
			position: relative;
		}

		.tips {
			display: flex;
			position: absolute;
			bottom: 4%;
			height: 33px;
		}

		.tips div {
			width: 90px;
			/* height: 40px; */
			line-height: 33px;
			text-align: center;
			/* padding: 10px; */
			color: #fff;
			background-color: #404040;
		}

		.tips img {
			width: 31px;
			height: 33px;
			position: absolute;
			right: -28px;
		}

		.textbox .title {
			margin: 10px 0px;
			color: #333333;
			font-size: 18px;
			font-weight: bold;
		}

		.textbox .txtD {
			color: #666;
			font-size: 14px;
			font-weight: normal;
			line-height: 18px;
			height: 36px;
			word-break: break-all;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			overflow: hidden;
			-webkit-line-clamp: 2;
		}


		.more {
			position: relative;
			padding: 20px 20px 20px 20px;
			font-size: 14px;
			color: #333;
			background-color: #fff;
			z-index: 4 !important;
		}

		.more {
			background-image: linear-gradient(#fdd000, #fdd000);
			background-position: left bottom;
			background-size: 0 2px;
			background-repeat: no-repeat;
			transition: .3s;
		}

		.jjfabox:hover .more {
			background-size: 100% 2px;
		}

		.el-col {
			margin-top: 10px;
		}

		.el-pagination.is-background .el-pager li:not(.disabled).active {
			background-color: #fdd000 !important;
			color: #FFF;
		}

		.el-pagination.is-background .el-pager li:not(.disabled):hover {
			color: #606266 !important;
			background-color: #fdd000 !important;
		}

	}

	@media screen and (min-width:970px) {
		.topImg {
			background-image: url(../assets/lm-ban2.jpg);
			background-position: 10%;
			width: 100%;
			height: 40vh;
			color: #fff;
			position: relative;
		}

		.topImg .title {
			font-size: 36px;
			font-weight: bold;
			line-height: 20px;
			position: absolute;
			top: 40%;
			left: 6%;
		}

		@keyframes slideInFromLeft {
			0% {
				background-color: transparent;
				/* 动画开始时背景色透明 */
			}

			100% {
				background-color: rgba(255, 255, 255, 0.1);
				/* 动画结束时的背景色 */
			}
		}

		/* 应用动画到元素 */
		/* .slide-in-animation {
		  animation: slideInFromLeft 2s ease-in-out forwards;
		} */
		.tabs {
			width: 100%;
			height: 20%;
			position: absolute;
			left: 0;
			bottom: 0;
			display: flex;
			align-items: center;
			background: rgba(255, 255, 255, 0.1);
			/* animation: slideInFromLeft 4s ease-in-out forwards; */
		}

		.leftTan {
			visibility: visible;
			animation-name: fadeInLeft;
			/*fadeInLeft为要使用的动画效果名，在这里不需要加animate前缀*/
			animation-duration: 3s;
		}

		.iconbox {
			width: 70px;
			height: 100%;
			background: #FDD000;
			display: inline-block;
			vertical-align: middle;
			text-align: center;
			margin: 0 2% 0 6%;
		}

		.tabs img {
			width: 26px;
			height: 100%;

		}

		.el-breadcrumb__inner a,
		.el-breadcrumb__inner.is-link {
			font-size: 16px;
			font-weight: 700;
			text-decoration: none;
			transition: color .2s cubic-bezier(.645, .045, .355, 1);
			color: #848692;
		}

		.el-breadcrumb__separator {
			margin: 0 9px;
			font-weight: 700;
			color: #848692;
		}

		.el-breadcrumb__inner {
			color: #fff;
			font-size: 16px;
			font-weight: 700;
		}

		.el-breadcrumb__item:last-child .el-breadcrumb__inner,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner a,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,
		.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover {
			font-weight: 700;
			color: #fff;
			font-size: 16px;
			cursor: text;
		}

		.jjfabox {
			/* height: 40vh; */
			box-shadow: 0px 8px 36.8px 3.2px rgba(0, 0, 7, 0.1);
			position: relative;
			overflow: hidden;
		}

		.imgbox img {
			width: 100%;
			overflow: hidden;
		}

		.textbox {
			width: 100%;
			transition: transform 0.3s;
			padding: 20px;
			position: absolute;
			transform: translateY(100%);
			/* 初始状态卡片在右侧 */
			bottom: 110px;
			transition: transform 0.3s;
			z-index: 1;
			background-color: #fff;
		}

		.jjfabox:hover .textbox {
			transform: translateY(50%);
			/* opacity: 1; */
		}

		.jjfabox:hover .title {
			color: #FDD000;
		}

		.jjfabox:hover .imgbg {
			transform: scale(1.1);
		}

		.imgbox {
			position: relative;
		}

		.tips {
			display: flex;
			position: absolute;
			bottom: 4%;
			height: 33px;
		}

		.tips div {
			width: 90px;
			/* height: 40px; */
			line-height: 33px;
			text-align: center;
			/* padding: 10px; */
			color: #fff;
			background-color: #404040;
		}

		.tips img {
			width: 31px;
			height: 33px;
			position: absolute;
			right: -28px;
		}

		.textbox .title {
			margin: 10px 0px;
			color: #333333;
			font-size: 18px;
			font-weight: bold;
		}

		.textbox .txtD {
			color: #666;
			font-size: 14px;
			font-weight: normal;
			line-height: 18px;
			height: 36px;
			word-break: break-all;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			overflow: hidden;
			-webkit-line-clamp: 2;
		}


		.more {
			position: relative;
			padding: 20px 20px 20px 20px;
			font-size: 14px;
			color: #333;
			background-color: #fff;
			z-index: 4 !important;
		}

		.more {
			background-image: linear-gradient(#fdd000, #fdd000);
			background-position: left bottom;
			background-size: 0 2px;
			background-repeat: no-repeat;
			transition: .3s;
		}

		.jjfabox:hover .more {
			background-size: 100% 2px;
		}

		.el-col {
			margin-top: 20px;
		}

		.el-pagination.is-background .el-pager li:not(.disabled).active {
			background-color: #fdd000 !important;
			color: #FFF !important;
		}

		.el-pagination.is-background .el-pager li:not(.disabled):hover {
			color: #606266 !important;
			background-color: #fdd000 !important;
		}


	}
</style>